f02wef
f02wef
© Numerical Algorithms Group, 2002.
Purpose
F02WEF SVD of real matrix
Synopsis
[a,q,sv,pt,b,ifail] = f02wef(a<,wantp,wantq,b,ifail>)
Description
The m by n matrix A is factorized as
T
A=QDP ,
where
(S)
D=(0), m>n,
D=S, m=n,
D=(S 0), m<n,
Q is an m by m orthogonal matrix, P is an n by n orthogonal
matrix and S is a min(m,n) by min(m,n) diagonal matrix with non-
negative diagonal elements, sv ,sv ,...,sv , ordered such
1 2 min(m,n)
that
sv >=sv >=...>=sv >=0.
1 2 min(m,n)
The first min(m,n) columns of Q are the left-hand singular
vectors of A, the diagonal elements of S are the singular values
of A and the first min(m,n) columns of P are the right-hand
singular vectors of A.
Either or both of the left-hand and right-hand singular vectors
of A may be requested and the matrix C given by
T
C=Q B,
where B is an m by ncolb given matrix, may also be requested.
Note that if K is any orthogonal diagonal matrix so that
T
KK =I,
(so that K has elements +1 or -1 on the diagonal)
then
T
A=(QK)D(PK)
is also a singular value decomposition of A.
Parameters
f02wef
Required Input Arguments:
a (:,:) real
Optional Input Arguments: <Default>
wantp logical 1
wantq logical 1
b (:,:) real zeros(size(a,1),1)
ifail integer -1
Output Arguments:
a (:,:) real
q (:,:) real
sv (:) real
pt (:,:) real
b (:,:) real
ifail integer